<?PHP

/**
 * General Public License as published by the Free Software Foundation
 * (see <http://www.gnu.org/licenses/ for more information).
 * @author Chris Reekie
 * @version 3/26/2011
 *
 * CIS 605
 * Donor Individual View
 */
/**
 * Displays Donor name email and address
 */
include_once('\../db-control/dbDonor2.php');
$allIndividuals = getAllIndividuals();
//echo $allIndividuals;  //debug
if ($allIndividuals == false) {
    echo "Sorry, No individual donors in database at this time.";
} else {
    $rows = mysql_num_rows($allIndividuals);
    echo "<table border='3' bordercolor='#FFFFFF' width='80%' bgcolor='#04819e' >
<tr>
<th><font face='Verdana, Arial, Helvetica, sans-serif' size='4' color='#FFE1E1'> Donor Name</font></th>
<th><font face='Verdana, Arial, Helvetica, sans-serif' size='4' color='#FFE1E1'> e-mail</font></th>
<th><font face='Verdana, Arial, Helvetica, sans-serif' size='4' color='#FFE1E1'> Phone Number</font></th>
<th><font face='Verdana, Arial, Helvetica, sans-serif' size='4' color='#FFE1E1'> Address</font></th>
</tr>";

    for ($j = 0; $j < $rows; $j++) {
        $row = mysql_fetch_assoc($allIndividuals);
        $dName = $row["firstName"] . " " . $row["lastName"];
        $email = $row["email"];
        $phone = $row["phone"];
        $address = $row["street"] . " " . $row["city"] . ", " . $row["stateName"] . " " . $row["zip"];

        echo "<tr>";
        echo "<td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFE1E1'>" . $dName . "</font></td>";
        echo "<td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFE1E1'>" . $email . "</font></td>";
        echo "<td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFE1E1'>" . $phone . "</font></td>";
        echo "<td><font face='Verdana, Arial, Helvetica, sans-serif' size='2' color='#FFE1E1'>" . $address . "</font></td>";
        echo "</tr>";
    }
    echo "</table> ";
}
